<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ES代码</title>
</head>
<script>
    const ArrayConcat = (arr, ...args) => arr.concat(args);
    const difference = (a, b) => {
        const s = new Set(b);
        return a.filter(x => !s.has(x));
    };
    const intersection  = (a, b) => {
        const s = new Set(b);
        return a.filter(x => s.has(x));
    };
    const includes = (collection, val, fromIndex=0) => collection.slice(fromIndex).indexOf(val) != -1;
    const remove =(arr, func) => {
        Array.isArray(arr) ? arr.filter(func).reduce((acc, val) => {
            arr.splice(arr.indexOf(val), 1);
            return acc.concat(val);
        })
        : [];
    };
    const sample = arr => arr[Math.floor(Math.random() * arr.length)];

    console.log(sample([3, 7, 9, 11]));



</script>
<body>
    
</body>
</html>